Package words.bookmark

Source Code of words.bookmark.AsposeBookmarks

package words.bookmark;

import com.aspose.words.Bookmark;
import com.aspose.words.Document;
import com.aspose.words.DocumentBuilder;
import com.aspose.words.SaveFormat;

public class AsposeBookmarks
{
  // See more @ http://www.aspose.com/docs/display/wordsjava/Bookmarks+in+Aspose.Words
 
  public static void main(String[] args) throws Exception
  {
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);

    builder.startBookmark("AsposeBookmark");
    builder.writeln("Text inside a bookmark.");
    builder.endBookmark("AsposeBookmark");
   
    // By index.
    Bookmark bookmark1 = doc.getRange().getBookmarks().get(0);

    // By name.
    Bookmark bookmark2 = doc.getRange().getBookmarks().get("AsposeBookmark");
   
    doc.save("data/AsposebBookmark.doc", SaveFormat.DOC);
  }
}
TOP

Related Classes of words.bookmark.AsposeBookmarks

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.